// page/purchOrder/purchOrder.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
      obj:[
        { id: '0', num: 'SHX485465446', price: '200', supplier: '东三环', date: '2015-03-15', name: '小明', status: 0 },
        { id: '2', num: 'HVV534666645', price: '300', supplier: '东四环', date: '2015-03-15', name: '小红', status: 1 },
        { id: '3', num: 'SHX485465446', price: '400', supplier: '东无环', date: '2015-03-15', name: '小刚', status: 0 },
        { id: '4', num: 'HVV534666645', price: '500', supplier: '东留环', date: '2015-03-15', name: '小军', status: 2 },
        { id: '5', num: 'SHX485465446', price: '600', supplier:'东器环',date:'2015-03-15',name:'小绿',status:0},
      ],
    dateStart:'2016-07-08',
    dateEnd:'2016-07-09'
  },

  // 显示遮罩层
  showModal: function () {
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    this.setData({
      animationData: animation.export(),
      showModalStatus: true
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export()
      })
    }.bind(this), 200)
  },
  // 隐藏遮罩层
  hideModal: function () {
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    this.setData({
      animationData: animation.export(),
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export(),
        showModalStatus: false
      })
    }.bind(this), 200)
  },
  screen(){
    this.showModal()
  },
  dateStartChange: function (e) {
    this.setData({
      dateStart: e.detail.value
    })
  },
  dateEndChange(e){
    this.setData({
      dateEnd: e.detail.value
    })
  },
  newPurch(){
    wx.navigateTo({
      url: '/pages/purchase/newMater/newMater',
    })
  },
  jumpDetail(e){
    console.log(e)
    wx.navigateTo({
      url: '/pages/purchase/procureDetails/procureDetails',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})